﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using XyzServices;
using System.ServiceModel.Description;

namespace XyzHost
{
    class Program
    {
        static void Main(string[] args)
        {
            Uri _uri = new Uri("http://localhost:8090/XyzServices/CalculationService");

            ServiceHost host = new ServiceHost(typeof(CalculationService),_uri);
            
            host.AddServiceEndpoint(typeof(ICalculationService), new WSHttpBinding(), _uri.ToString());
            //host.AddServiceEndpoint(typeof(ICalculationService), new BasicHttpBinding(), _uri.ToString());

            ServiceMetadataBehavior metadatabehavior = new ServiceMetadataBehavior();
            metadatabehavior.HttpGetEnabled = true;
            host.Description.Behaviors.Add(metadatabehavior);

            Console.WriteLine("Servis aktif ediliyor...");
            host.Open();
            Console.WriteLine("Servis aktif. Durdurmak için bir tuşa basınız.");
            Console.ReadLine();
            host.Close();
        }
    }
}
